package com.jintian.smart.kernel.switching.dto;

import java.io.UnsupportedEncodingException;

public class FileDataPacket extends DataPacket {
    private static final long serialVersionUID = 1L;

    public String getFileName() {
        try {
            return new String(this.getData(), "utf-8");
        } catch (UnsupportedEncodingException e) {
            throw new IllegalArgumentException(e.getMessage());
        }
    }

    public void setFileName(String fileName) {
        try {
            this.setData(fileName.getBytes("utf-8"));
        } catch (UnsupportedEncodingException e) {
            throw new IllegalArgumentException(e.getMessage());
        }
    }
}
